package com.dmcliver.timetracker.entity;

// Generated 19/02/2014 8:57:30 PM by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.NotNull;

/**
 * Timeentry generated by hbm2java
 */
@Entity
@Table(name = "TIMEENTRY", schema = "TESTABUSER")
public class Timeentry implements java.io.Serializable {

	private BigDecimal timeentryid;
	private Job job;
	private Person person;
	private Date startdatetime;
	private Date enddatetime;
	private Set<Feedback> feedbacks = new HashSet<Feedback>(0);

	public Timeentry() {
	}

	public Timeentry(BigDecimal timeentryid, Job job, Person person,
			Date startdatetime, Date enddatetime) {
		this.timeentryid = timeentryid;
		this.job = job;
		this.person = person;
		this.startdatetime = startdatetime;
		this.enddatetime = enddatetime;
	}

	public Timeentry(BigDecimal timeentryid, Job job, Person person,
			Date startdatetime, Date enddatetime, Set<Feedback> feedbacks) {
		this.timeentryid = timeentryid;
		this.job = job;
		this.person = person;
		this.startdatetime = startdatetime;
		this.enddatetime = enddatetime;
		this.feedbacks = feedbacks;
	}

	@Id
	@Column(name = "TIMEENTRYID", precision = 22, scale = 0)
	@NotNull
	public BigDecimal getTimeentryid() {
		return this.timeentryid;
	}

	public void setTimeentryid(BigDecimal timeentryid) {
		this.timeentryid = timeentryid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "JOBID", nullable = false)
	@NotNull
	public Job getJob() {
		return this.job;
	}

	public void setJob(Job job) {
		this.job = job;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PERSONID", nullable = false)
	@NotNull
	public Person getPerson() {
		return this.person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "STARTDATETIME", nullable = false, length = 7)
	@NotNull
	public Date getStartdatetime() {
		return this.startdatetime;
	}

	public void setStartdatetime(Date startdatetime) {
		this.startdatetime = startdatetime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ENDDATETIME", nullable = false, length = 7)
	@NotNull
	public Date getEnddatetime() {
		return this.enddatetime;
	}

	public void setEnddatetime(Date enddatetime) {
		this.enddatetime = enddatetime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "timeentry")
	public Set<Feedback> getFeedbacks() {
		return this.feedbacks;
	}

	public void setFeedbacks(Set<Feedback> feedbacks) {
		this.feedbacks = feedbacks;
	}

}
